package com.xygj.vueblog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xygj.vueblog.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("SELECT * FROM User WHERE id = #{id}")
    public User selectById(@Param("id") Integer id);

    @Select("SELECT * FROM User WHERE username = #{username} AND password = #{password}")
    public User queryUserByName(String username, String password);

    @Select("SELECT * FROM User WHERE username = #{username}")
    public User findName(String username);

}
